DEF_PROJECT=../../..
include $(DEF_PROJECT)/scripts/main.mk
name=iproute2
version=3.5.1
prefix=/usr
destdir=$(DIR_SYSROOT)
extdeps=eglibc-tools gcc-tools binutils-tools linux-header-tools

DL_SERV=http
DL_HOST=www.kernel.org
DL_PATH=pub/linux/utils/net/$(name)
DL_SUFFIX=tar.bz2

cflags+=--host=$(CC_TARGET)
cflags+=--build=$(CC_HOST)

mflags+=CC=$(addsuffix -,$(CC_TARGET))gcc

pre-build:
	sed -i -e 's/^gcc/$(addsuffix -,$(CC_TARGET))gcc/' -e 's/^if gcc/if $(addsuffix -,$(CC_TARGET))gcc/' $(source)/configure
	sed -i '/^TARGETS/s@arpd@@g' $(source)/misc/Makefile
	sed -i '/ARPD/d' $(source)/Makefile
	sed -i 's/arpd.8//' $(source)/man/man8/Makefile
	cd $<;$(cdefs) ./configure $(cflags)
